package tpi.gui

import dominio.factory.FactoryGame
import dominio.investigacion.Expedientes
import org.apache.wicket.markup.html.WebPage
import org.apache.wicket.markup.html.basic.Label
import org.apache.wicket.markup.html.form.Form
import org.apache.wicket.model.CompoundPropertyModel
import org.uqbar.wicket.xtend.WicketExtensionFactoryMethods
import org.uqbar.wicket.xtend.XListView

class ExpedientesPage extends WebPage {
	
	extension WicketExtensionFactoryMethods = new WicketExtensionFactoryMethods
	
	new() {
		val Form<Expedientes> form = new Form<Expedientes>("expedientesForm", new CompoundPropertyModel(new FactoryGame().expedientes))
		val listView = new XListView("villanos")
		listView.populateItem = [item |
			item.model = item.modelObject.asCompoundModel
			item.addChild(new Label("nombre"))
		]
		form.addChild(listView)
		addChild(form)		
	}
	
}